<template>
  <div>
    <div id="columnar" style="width: 100%; height: 100%" />
  </div>
</template>
<script>
// 导入echarts包
import * as echarts from 'echarts'
// 指定一个dom元素，来显示图标
// var option
export default {
  data() {
    return {
option: {
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'shadow'
    }
  },
  legend: {
    show: false
  },
  grid: {
    height: '100%',
    left: '0%',
    bottom: '3%',
    containLabel: true
  },
  xAxis: [
    {
      type: 'category',
      data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
    }
  ],
  yAxis: [
    {
      type: 'value'
    }
  ],
  series: [
    {
      name: '单选题',
      type: 'bar',
      stack: 'Ad',
      emphasis: {
        focus: 'series'
      },
      data: [79, 50, 200, 334, 390, 330, 220]
    },
    {
      name: '多选题',
      type: 'bar',
      stack: 'Ad',
      emphasis: {
        focus: 'series'
      },
      data: [79, 50, 200, 334, 390, 330, 220]
    },
    {
      name: '简单题',
      type: 'bar',
      stack: 'Ad',
      emphasis: {
        focus: 'series'
      },
      data: [79, 50, 200, 334, 390, 330, 220]
    }

  ]
}
    }
  },
  mounted() {
var chartDom = document.getElementById('columnar')
var myChart = echarts.init(chartDom)
    this.option && myChart.setOption(this.option)
  }
}
</script>
